package com.zm.scsimple.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author zoum
 * @create 2019/2/26 16:54
 */
@RestController
public class RibbonClientController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/hi")
    public String sayHi(String name){
        return restTemplate.getForObject("http://ribbon-service/hi?name=" + name, String.class);
    }
}
